using System;
using System.Web.UI;
using System.Web;
using System.Threading;
using CultureInfo = System.Globalization.CultureInfo;

namespace Abhar.web.src
{
    public static class Extentions
    {
        public static void SwitchLanguage(this MasterPage control, Language lang)
        {
            HttpContext.Current.Session["Lang"] = lang;
            HttpContext.Current.Response.Redirect(HttpContext.Current.Request.RawUrl);
        }
        public static Language GetCurrentLanguage(this MasterPage control)
        {
            var objTemp = HttpContext.Current.Session["Lang"];
            if (objTemp == null)
                return Language.English;
            return (Language) objTemp;
        }
        public static Language GetCurrentLanguage(this Control control)
        {
            var objTemp = HttpContext.Current.Session["Lang"];
            if (objTemp == null)
                return Language.English;
            return (Language)objTemp;
        }
    }

    public enum Language
    {
        English,
        Arabic
    }
}
